import 'package:app/util/WebSocketManager.dart';
import 'package:flutter/material.dart';

class WebSocketInheritedWidget extends InheritedWidget {

  late WebsocketManager socket;

  WebSocketInheritedWidget({super.key, required this.socket, required Widget child})
      : super(child: child);

  @override
  bool updateShouldNotify(WebSocketInheritedWidget oldWidget) {
    return socket != oldWidget.socket;
  }

  static WebSocketInheritedWidget? of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<WebSocketInheritedWidget>();
  }
}